<template>
	<div class="header">
		<!-- 左侧 -->
		<div class="header-left">
			<span class="iconfont">&#xe605;</span>
		</div>
		<!-- 中部 -->
		<div class="header-search">
			<span class="iconfont">&#xe632;</span>
			<span>输入城市/景点/游玩主题</span>
		</div>
		<!-- 右侧 -->
		<div class="header-right">
			<router-link to="/city">
				<label>{{city}}</label><span class="iconfont">&#xe62a;</span>
			</router-link>
		</div>
	</div>
	
</template>

<script>
	//引入vuex的mapState()
	import {mapState} from 'vuex'
	
	export default{
		computed:{
			...mapState(['city'])
		}
	}
</script>



<!-- sconped 局部样式-->
<style scoped>
	.header{
		width: 100%;
		height: 0.88rem;/* ;0.88rem */
		background-color: #00bcd4;
		color: white;
		font-size: 0.36rem;/* 0.36rem */
		display: flex; /* 弹性盒子*/
		line-height: 0.88rem;
	}
	/* 搜索框 */
	.header-search{
		flex: 1;/* 占领剩余空间 */
		background-color: white;
		height: 0.6rem;
		border-radius: 0.1rem;
		color: gainsboro;
		line-height: 0.6rem;
		font-size: 0.28rem;
		margin-top: 0.14rem;
	}
	.header-search .iconfont{
		margin: 0px 0.1rem;
	}
	.header-left{
		width: 0.4rem;
		padding: 0px 0.2rem;
		font-weight:bold;
		text-align: center;
	}
	.header-right{
		padding: 0px 0.2rem;
		font-size:0.32rem;
	}
	.header-right a{
		color:white;
	}
	.header-right .iconfont{
		font-size: 0.2rem !important;
		margin-left: 0.1rem;
	}
</style>
